#include "PrecompiledHeader.h"
#include "ConfigurationPanels.h"
#include "ix86-32/iR5900-32.h"
#include "R5900.h"
/*
using namespace pxSizerFlags;

Panels::ValDanX_EEPanel::ValDanX_EEPanel( wxWindow* parent ) :
	BaseApplicableConfigPanel( parent )
{
	wxPanelWithHelpers* top	= new wxPanelWithHelpers( this, wxVERTICAL );

	top->SetMinWidth( 300 );

	wxStaticBoxSizer& groupSizer = *new wxStaticBoxSizer( wxVERTICAL, this, _("EE") );
	struct CheckTextMess
	{
		wxString label, tooltip;
	};

	const CheckTextMess check_text[NUM_OF_VALDANX_EE] =
	{
		{
			_("Enable status value [NOT RECOMMENDED] "),
			wxEmptyString
		},
		{
			_("Disable auto reset iR5900-32 [WARNING!] "),
			wxEmptyString
		},
		{
			_("Enable GPR is const (speed up!) [RECOMMENDED] "),
			wxEmptyString
		},
		{
			_("Enable FPU test [NOT RECOMMENDED] "),
			wxEmptyString
		},
		{
			_("Enable dyna block discard (speed up!) [RECOMMENDED] "),
			wxEmptyString
		},
		{
			_("Enable recCACHE [NOT RECOMMENDED] "),
			wxEmptyString
		},
		{
			_("Disable reset CPU [WARNING!] "),
			wxEmptyString
		},
		{
			_("Disable wait MTGS if CPU reset [RECOMMENDED] "),
			wxEmptyString
		}
	};
	for( int i=0; i<NUM_OF_VALDANX_EE; ++i )
	{
		groupSizer += (m_checkbox[i] = new pxCheckBox( this, check_text[i].label ));
		m_checkbox[i]->SetToolTip( check_text[i].tooltip );
	}
wxPanelWithHelpers* left	= new wxPanelWithHelpers( this, wxVERTICAL );
left->SetMinWidth( 200 );
wxButton* SpeedStable    = new wxButton( left, wxID_ANY, _("Default Speed Stable")    );
wxButton* SpeedUnStable  = new wxButton( left, wxID_ANY, _("Default Speed UnStable")  );
wxButton* SpeedWarning   = new wxButton( left, wxID_ANY, _("Default Speed Warning")   );

wxButton*  RestartiR5900_32     = new wxButton( top, wxID_ANY, _("Reset iR5900-32")    );
wxButton*  TestFPU              = new wxButton( top, wxID_ANY, _("FPU Test")           );
wxButton*  ResetCPU             = new wxButton( top, wxID_ANY, _("Reset CPU")          );
*left   += SpeedStable               | pxExpand;
*left   += SpeedUnStable             | pxExpand;
*left   += SpeedWarning              | pxExpand;

*this	+= groupSizer         		 | pxCenter;
*top	+= 5;
*top	+= RestartiR5900_32          | pxExpand;
*top	+= TestFPU                   | pxExpand;
*top	+= ResetCPU                  | pxExpand;
*this   += top              		 | pxCenter;
*this   += 20;
*this   += left	     		         | pxExpand;

Connect( RestartiR5900_32->GetId(),    wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ValDanX_EEPanel::ReiR5900_32) );
Connect( TestFPU->GetId(),             wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ValDanX_EEPanel::Test_FPU)    );
Connect( ResetCPU->GetId(),            wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ValDanX_EEPanel::Reset_CPU)    );

Connect( SpeedStable   -> GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ValDanX_EEPanel::AppStatusEvent_DefaultSpeed  ) );
Connect( SpeedUnStable -> GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ValDanX_EEPanel::AppStatusEvent_DefaultUnSpeed) );
Connect( SpeedWarning  -> GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ValDanX_EEPanel::AppStatusEvent_DefaultWarning) );
}

void Panels::ValDanX_EEPanel::Apply()
{

	Pcsx2Config::ValDanX_EEOptions& opts( g_Conf->EmuOptions.ValDanX_EE );
	for (int i = 0; i < NUM_OF_VALDANX_EE; i++)
    {
        if (m_checkbox[i]->GetValue())
        {
            opts.bitset |= (1 << i);
        }
        else
        {
            opts.bitset &= ~(1 << i);
        }
	}
}
void Panels::ValDanX_EEPanel::Test_FPU( wxCommandEvent& evt )
{
	Vtestfpu();
}
void Panels::ValDanX_EEPanel::Reset_CPU( wxCommandEvent& evt )
{
	VcpuReset();
}
void Panels::ValDanX_EEPanel::ReiR5900_32( wxCommandEvent& evt )
{
	VrecResetEE();
}
void Panels::ValDanX_EEPanel::AppStatusEvent_DefaultSpeed( wxCommandEvent& evt )
{
Pcsx2Config::ValDanX_EEOptions& opts( g_Conf->EmuOptions.ValDanX_EE );
for (int i = 0; i < NUM_OF_VALDANX_EE; i++)
    {
	ValDanX_EEPanel::m_checkbox[0]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[1]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[2]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[3]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[4]->SetValue( true );
	ValDanX_EEPanel::m_checkbox[5]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[6]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[7]->SetValue( false );
}
}
void Panels::ValDanX_EEPanel::AppStatusEvent_DefaultUnSpeed( wxCommandEvent& evt )
{
	for (int i = 0; i < NUM_OF_VALDANX_EE; i++)
    {
	ValDanX_EEPanel::m_checkbox[0]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[1]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[2]->SetValue( true );
	ValDanX_EEPanel::m_checkbox[3]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[4]->SetValue( true );
	ValDanX_EEPanel::m_checkbox[5]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[6]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[7]->SetValue( false );
	}
}
void Panels::ValDanX_EEPanel::AppStatusEvent_DefaultWarning( wxCommandEvent& evt )
{
	for (int i = 0; i < NUM_OF_VALDANX_EE; i++)
    {
	ValDanX_EEPanel::m_checkbox[0]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[1]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[2]->SetValue( true );
	ValDanX_EEPanel::m_checkbox[3]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[4]->SetValue( true );
	ValDanX_EEPanel::m_checkbox[5]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[6]->SetValue( false );
	ValDanX_EEPanel::m_checkbox[7]->SetValue( true );
	}
}

void Panels::ValDanX_EEPanel::AppStatusEvent_OnSettingsApplied()
{
	const Pcsx2Config::ValDanX_EEOptions& opts( g_Conf->EmuOptions.ValDanX_EE );
	for( int i=0; i<NUM_OF_VALDANX_EE; ++i )
	{
		m_checkbox[i]->SetValue( !!(opts.bitset & (1 << i)) );
	}
}*/